#pragma once

#include "IEffectDescription.h"
#include "PolaroidEffect.h"

using namespace DeForm;

namespace Tools
{
	inline void Check(HRESULT hr)
	{
		if (FAILED(hr))
		{
			throw Platform::Exception::CreateException(hr);
		}
	}

	inline GUID GetEffectGUID(EffectType type)
	{
		switch (type)
		{
			case EffectType::Blur:
				return CLSID_D2D1GaussianBlur;
			case EffectType::ConvolveMatrix:
				return CLSID_D2D1ConvolveMatrix;
			case EffectType::ColorMatrix:
				return CLSID_D2D1ColorMatrix;
			case EffectType::Morphology:
				return CLSID_D2D1Morphology;
			case EffectType::Saturation:
				return CLSID_D2D1Saturation;
			case EffectType::Hue:
				return CLSID_D2D1HueRotation;
			case EffectType::Brightness:
				return CLSID_D2D1Brightness;
			case EffectType::Polaroid:
				return CLSID_Polaroid;
			default:
				return GUID();
		}
	}
};

